// 2019/3/4

const async = require("async");

let tasks = {
    slow: function(callback) {
        setTimeout(function() {
            callback(null, 'slow');
        }, 200);
    },
    fast: function(callback) {
        setTimeout(function() {
            callback(null, 'fast');
        }, 100);
    }
}

tasks = async.reflectAll(tasks);

async.parallel(tasks, function(err, results) {
    console.log('Async end');
    console.log(`Error: ${JSON.stringify(err)}`);
    console.log(`Result: ${JSON.stringify(results)}`);
});
